package com.dadaguai.utils;

import com.dadaguai.dto.SystemDto.SystemSettingDto;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class SysSettingUtils {
    private static final String SYS_KEY = "sys_setting";
    private static final Map<String, SystemSettingDto> CACHE_DATA = new ConcurrentHashMap<>();

    /**
     * 获取系统设置
     * @return
     */
    public static SystemSettingDto getSysSettings() {
        return CACHE_DATA.get(SYS_KEY);
    }

    /**
     * 更新系统设置
     * @param dto
     */
    public static void refresh(SystemSettingDto dto){
        CACHE_DATA.put(SYS_KEY,dto);
    }
}
